package com.example.mybatisplus.controller;

import com.example.mybatisplus.entity.EmployeeInfo;
import org.springframework.cache.annotation.Cacheable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
public class LexController {

    @RequestMapping("getAll")
    @Cacheable(value = "LexController",key = "'getAll'")
    public List<EmployeeInfo> getAll(){
        EmployeeInfo employeeInfo = new EmployeeInfo();
        List<EmployeeInfo> employeeInfos = employeeInfo.selectAll();
        employeeInfos.forEach(System.err::println);
        return employeeInfos;
    }
}
